<template>
  <el-row :gutter="20">
    <!-- 左侧部门树 -->
    <el-col :span="4" :xs="24">
      <ContentWrap class="h-1/1">
        <DeptTree @node-click="handleDeptNodeClick" />
      </ContentWrap>
    </el-col>
    <el-col :span="20" :xs="24">

  <ContentWrap>
    <!-- 搜索工作栏 -->
    <el-form
      class="-mb-15px"
      :model="queryParams"
      ref="queryFormRef"
      :inline="true"
      label-width="68px"
    >
      <!-- <el-form-item label="资产分类" prop="categoryName">
        <el-input
          v-model="queryParams.categoryName"
          placeholder="请输入资产分类"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <!-- <el-form-item label="分类编码" prop="categoryCode">
        <el-input
          v-model="queryParams.categoryCode"
          placeholder="请输入分类编码"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="业务编号" prop="businessCode">
        <el-input
          v-model="queryParams.businessCode"
          placeholder="请输入业务编号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <!-- <el-form-item label="流程ID" prop="procId">
        <el-input
          v-model="queryParams.procId"
          placeholder="请输入流程ID"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <!-- <el-form-item label="办理状态" prop="status">
        <el-select
          v-model="queryParams.status"
          placeholder="请选择办理状态"
          clearable
          class="!w-240px"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item> -->
      <!-- <el-form-item label="批次编码" prop="batchCode">
        <el-input
          v-model="queryParams.batchCode"
          placeholder="请输入批次编码"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <!-- <el-form-item label="归属" prop="ownerCode">
        <el-input
          v-model="queryParams.ownerCode"
          placeholder="请输入归属"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <el-form-item label="资产编号" prop="assetCode">
        <el-input
          v-model="queryParams.assetCode"
          placeholder="请输入资产编号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="财务编码" prop="financialCode">
        <el-input
          v-model="queryParams.financialCode"
          placeholder="请输入财务编码"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <!-- <el-form-item label="资产状态" prop="assetStatus">
        <el-select
          v-model="queryParams.assetStatus"
          placeholder="请选择资产状态"
          clearable
          class="!w-240px"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="是否显示" prop="display">
        <el-input
          v-model="queryParams.display"
          placeholder="请输入是否显示"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="清理类型" prop="cleanOutType">
        <el-select
          v-model="queryParams.cleanOutType"
          placeholder="请选择清理类型"
          clearable
          class="!w-240px"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="是否清理" prop="cleanOut">
        <el-input
          v-model="queryParams.cleanOut"
          placeholder="请输入是否清理"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="清理时间" prop="cleanTime">
        <el-date-picker
          v-model="queryParams.cleanTime"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="标准物品档案" prop="goodsId">
        <el-input
          v-model="queryParams.goodsId"
          placeholder="请输入标准物品档案"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>-->
      <el-form-item label="资产名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入资产名称"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> 
      <!-- <el-form-item label="标准型号厂商" prop="manufacturerId">
        <el-input
          v-model="queryParams.manufacturerId"
          placeholder="请输入标准型号厂商"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="标准型号规格型号" prop="model">
        <el-input
          v-model="queryParams.model"
          placeholder="请输入标准型号规格型号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="标准型号物品图片" prop="pictureId">
        <el-input
          v-model="queryParams.pictureId"
          placeholder="请输入标准型号物品图片"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="标准型号计量单位" prop="unit">
        <el-input
          v-model="queryParams.unit"
          placeholder="请输入标准型号计量单位"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="使用期限,(月)" prop="serviceLife">
        <el-input
          v-model="queryParams.serviceLife"
          placeholder="请输入使用期限,(月)"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="安全等级" prop="safetyLevelCode">
        <el-input
          v-model="queryParams.safetyLevelCode"
          placeholder="请输入安全等级"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="序列号" prop="serialNumber">
        <el-input
          v-model="queryParams.serialNumber"
          placeholder="请输入序列号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="所属公司" prop="ownCompanyId">
        <el-input
          v-model="queryParams.ownCompanyId"
          placeholder="请输入所属公司"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="管理人员" prop="managerId">
        <el-input
          v-model="queryParams.managerId"
          placeholder="请输入管理人员"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="使用公司/部门" prop="useOrganizationId">
        <el-input
          v-model="queryParams.useOrganizationId"
          placeholder="请输入使用公司/部门"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <el-form-item label="保管员" prop="managerId">
        <el-select filterable v-model="queryParams.managerId" class="!w-240px" placeholder="管理人员" clearable>
          <el-option
            v-for="(user, index) in userList"
            :label="user.nickname"
            :value="user.id"
            :key="index"
          >
          {{user.nickname}}({{user.username}})
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="资产状态" prop="assetStatus">
        <el-select filterable v-model="queryParams.assetStatus" class="!w-240px" placeholder="资产状态" clearable>
          <el-option
          v-for="dict in getStrDictOptions(DICT_TYPE.eam_zc_status)"
          :key="dict.value"
          :label="dict.label"
          :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <!-- <el-form-item label="使用人员" prop="useUserId">
        <el-input
          v-model="queryParams.useUserId"
          placeholder="请输入使用人员"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="存放区域" prop="regionId">
        <el-input
          v-model="queryParams.regionId"
          placeholder="请输入存放区域"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="仓库" prop="warehouseId">
        <el-input
          v-model="queryParams.warehouseId"
          placeholder="请输入仓库"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="库存物品" prop="goodsStockId">
        <el-input
          v-model="queryParams.goodsStockId"
          placeholder="请输入库存物品"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="来源" prop="sourceId">
        <el-input
          v-model="queryParams.sourceId"
          placeholder="请输入来源"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="资产数量" prop="assetNumber">
        <el-input
          v-model="queryParams.assetNumber"
          placeholder="请输入资产数量"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="剩余数量" prop="remainNumber">
        <el-input
          v-model="queryParams.remainNumber"
          placeholder="请输入剩余数量"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="采购日期" prop="purchaseDate">
        <el-date-picker
          v-model="queryParams.purchaseDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="生产日期" prop="productionDate">
        <el-date-picker
          v-model="queryParams.productionDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="入账日期" prop="registerDate">
        <el-date-picker
          v-model="queryParams.registerDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="RFID标签" prop="rfid">
        <el-input
          v-model="queryParams.rfid"
          placeholder="请输入RFID标签"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="附件" prop="attach">
        <el-input
          v-model="queryParams.attach"
          placeholder="请输入附件"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="最近核对日期" prop="lastVerificationDate">
        <el-date-picker
          v-model="queryParams.lastVerificationDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="用途" prop="purpose">
        <el-input
          v-model="queryParams.purpose"
          placeholder="请输入用途"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="资产备注" prop="assetNotes">
        <el-input
          v-model="queryParams.assetNotes"
          placeholder="请输入资产备注"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="维保厂商" prop="maintainerId">
        <el-input
          v-model="queryParams.maintainerId"
          placeholder="请输入维保厂商"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="维保厂商" prop="maintainerName">
        <el-input
          v-model="queryParams.maintainerName"
          placeholder="请输入维保厂商"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="维保状态" prop="maintenanceStatus">
        <el-select
          v-model="queryParams.maintenanceStatus"
          placeholder="请选择维保状态"
          clearable
          class="!w-240px"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="维保价格" prop="maintenancePrice">
        <el-input
          v-model="queryParams.maintenancePrice"
          placeholder="请输入维保价格"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="维保方式" prop="maintenanceMethod">
        <el-input
          v-model="queryParams.maintenanceMethod"
          placeholder="请输入维保方式"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <!-- <el-form-item label="建议维保方式" prop="suggestMaintenanceMethod">
        <el-input
          v-model="queryParams.suggestMaintenanceMethod"
          placeholder="请输入建议维保方式"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="联系人" prop="contacts">
        <el-input
          v-model="queryParams.contacts"
          placeholder="请输入联系人"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="联系方式" prop="contactInformation">
        <el-input
          v-model="queryParams.contactInformation"
          placeholder="请输入联系方式"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="负责人" prop="director">
        <el-input
          v-model="queryParams.director"
          placeholder="请输入负责人"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="维保开始时间" prop="maintenanceStartDate">
        <el-date-picker
          v-model="queryParams.maintenanceStartDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="维保到期时间" prop="maintenanceEndDate">
        <el-date-picker
          v-model="queryParams.maintenanceEndDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="维保备注" prop="maintenanceNotes">
        <el-input
          v-model="queryParams.maintenanceNotes"
          placeholder="请输入维保备注"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="财务分类" prop="financialCategoryId">
        <el-input
          v-model="queryParams.financialCategoryId"
          placeholder="请输入财务分类"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="财务编号" prop="financialCode">
        <el-input
          v-model="queryParams.financialCode"
          placeholder="请输入财务编号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="财务选项" prop="financialOption">
        <el-input
          v-model="queryParams.financialOption"
          placeholder="请输入财务选项"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="费用项目" prop="expenseItem">
        <el-input
          v-model="queryParams.expenseItem"
          placeholder="请输入费用项目"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="资产供应商" prop="supplierId">
        <el-input
          v-model="queryParams.supplierId"
          placeholder="请输入资产供应商"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="客户信息" prop="customerInfo">
        <el-input
          v-model="queryParams.customerInfo"
          placeholder="请输入客户信息"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="含税总值,(含税数量>2)" prop="taxAmountPrice">
        <el-input
          v-model="queryParams.taxAmountPrice"
          placeholder="请输入含税总值,(含税数量>2)"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="未税总值,(数量>2)" prop="totalAmountPrice">
        <el-input
          v-model="queryParams.totalAmountPrice"
          placeholder="请输入未税总值,(数量>2)"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="含税单价,(含税)" prop="purchaseUnitPrice">
        <el-input
          v-model="queryParams.purchaseUnitPrice"
          placeholder="请输入含税单价,(含税)"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="资产原值,(未税)" prop="originalUnitPrice">
        <el-input
          v-model="queryParams.originalUnitPrice"
          placeholder="请输入资产原值,(未税)"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="资产净值,(当前)" prop="navPrice">
        <el-input
          v-model="queryParams.navPrice"
          placeholder="请输入资产净值,(当前)"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="已用期限,(月)" prop="assetUsedServiceLife">
        <el-input
          v-model="queryParams.assetUsedServiceLife"
          placeholder="请输入已用期限,(月)"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="最后折旧" prop="depreciationId">
        <el-input
          v-model="queryParams.depreciationId"
          placeholder="请输入最后折旧"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="最后折旧时间" prop="depreciationOperTime">
        <el-date-picker
          v-model="queryParams.depreciationOperTime"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="残值率" prop="residualsRate">
        <el-input
          v-model="queryParams.residualsRate"
          placeholder="请输入残值率"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="残值" prop="residualsPrice">
        <el-input
          v-model="queryParams.residualsPrice"
          placeholder="请输入残值"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="税额" prop="taxAmountRate">
        <el-input
          v-model="queryParams.taxAmountRate"
          placeholder="请输入税额"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="本年折旧" prop="currentYearDepreciation">
        <el-input
          v-model="queryParams.currentYearDepreciation"
          placeholder="请输入本年折旧"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="折旧年份" prop="depreciationYear">
        <el-input
          v-model="queryParams.depreciationYear"
          placeholder="请输入折旧年份"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="累计折旧" prop="accumulatedDepreciation">
        <el-input
          v-model="queryParams.accumulatedDepreciation"
          placeholder="请输入累计折旧"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="月折金额" prop="monthDepreciationPrice">
        <el-input
          v-model="queryParams.monthDepreciationPrice"
          placeholder="请输入月折金额"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="登记时间" prop="entryTime">
        <el-date-picker
          v-model="queryParams.entryTime"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="财务备注" prop="financialNotes">
        <el-input
          v-model="queryParams.financialNotes"
          placeholder="请输入财务备注"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="设备编号" prop="equipmentCode">
        <el-input
          v-model="queryParams.equipmentCode"
          placeholder="请输入设备编号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="启停状态" prop="equipmentStatus">
        <el-select
          v-model="queryParams.equipmentStatus"
          placeholder="请选择启停状态"
          clearable
          class="!w-240px"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="设备IP" prop="equipmentIp">
        <el-input
          v-model="queryParams.equipmentIp"
          placeholder="请输入设备IP"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <!-- <el-form-item label="管理IP" prop="manageIp">
        <el-input
          v-model="queryParams.manageIp"
          placeholder="请输入管理IP"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="设备CPU" prop="equipmentCpu">
        <el-input
          v-model="queryParams.equipmentCpu"
          placeholder="请输入设备CPU"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="设备内存" prop="equipmentMemory">
        <el-input
          v-model="queryParams.equipmentMemory"
          placeholder="请输入设备内存"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="设备标签" prop="equipmentLabel">
        <el-input
          v-model="queryParams.equipmentLabel"
          placeholder="请输入设备标签"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="设备配置" prop="equipmentConf">
        <el-input
          v-model="queryParams.equipmentConf"
          placeholder="请输入设备配置"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="设备运行环境" prop="equipmentEnvironmentCode">
        <el-input
          v-model="queryParams.equipmentEnvironmentCode"
          placeholder="请输入设备运行环境"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="设备序列号" prop="equipmentSerialNumber">
        <el-input
          v-model="queryParams.equipmentSerialNumber"
          placeholder="请输入设备序列号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="设备机柜" prop="rackId">
        <el-input
          v-model="queryParams.rackId"
          placeholder="请输入设备机柜"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="短标签1" prop="label">
        <el-input
          v-model="queryParams.label"
          placeholder="请输入短标签1"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="短标签3" prop="label3">
        <el-input
          v-model="queryParams.label3"
          placeholder="请输入短标签3"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="短标签5" prop="label5">
        <el-input
          v-model="queryParams.label5"
          placeholder="请输入短标签5"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="长标签4" prop="label4">
        <el-input
          v-model="queryParams.label4"
          placeholder="请输入长标签4"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="长标签2" prop="label2">
        <el-input
          v-model="queryParams.label2"
          placeholder="请输入长标签2"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="单据" prop="billId">
        <el-input
          v-model="queryParams.billId"
          placeholder="请输入单据"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="巡检时间" prop="lastInspectTime">
        <el-date-picker
          v-model="queryParams.lastInspectTime"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="经度数据" prop="longitude">
        <el-input
          v-model="queryParams.longitude"
          placeholder="请输入经度数据"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="维度数据" prop="dimension">
        <el-input
          v-model="queryParams.dimension"
          placeholder="请输入维度数据"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="内部控制标签" prop="internalControlLabel">
        <el-input
          v-model="queryParams.internalControlLabel"
          placeholder="请输入内部控制标签"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <!-- <el-form-item label="领用ID" prop="collectionId">
        <el-input
          v-model="queryParams.collectionId"
          placeholder="请输入领用ID"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="借用ID" prop="borrowId">
        <el-input
          v-model="queryParams.borrowId"
          placeholder="请输入借用ID"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="报废ID" prop="scrapId">
        <el-input
          v-model="queryParams.scrapId"
          placeholder="请输入报废ID"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="处置ID" prop="handleId">
        <el-input
          v-model="queryParams.handleId"
          placeholder="请输入处置ID"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime">
        <el-date-picker
          v-model="queryParams.createTime"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="制单人" prop="originatorId">
        <el-input
          v-model="queryParams.originatorId"
          placeholder="请输入制单人"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="变更类型" prop="chsType">
        <el-select
          v-model="queryParams.chsType"
          placeholder="请选择变更类型"
          clearable
          class="!w-240px"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="变更状态" prop="chsStatus">
        <el-select
          v-model="queryParams.chsStatus"
          placeholder="请选择变更状态"
          clearable
          class="!w-240px"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="变更版本号" prop="chsVersion">
        <el-input
          v-model="queryParams.chsVersion"
          placeholder="请输入变更版本号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="变更ID" prop="changeInstanceId">
        <el-input
          v-model="queryParams.changeInstanceId"
          placeholder="请输入变更ID"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="流程概要" prop="summary">
        <el-input
          v-model="queryParams.summary"
          placeholder="请输入流程概要"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="最后审批人账户ID" prop="latestApproverId">
        <el-input
          v-model="queryParams.latestApproverId"
          placeholder="请输入最后审批人账户ID"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="最后审批人姓名" prop="latestApproverName">
        <el-input
          v-model="queryParams.latestApproverName"
          placeholder="请输入最后审批人姓名"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="下一节点审批人" prop="nextApproverIds">
        <el-input
          v-model="queryParams.nextApproverIds"
          placeholder="请输入下一节点审批人"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="下一个审批节点审批人姓名，用逗号隔开" prop="nextApproverNames">
        <el-input
          v-model="queryParams.nextApproverNames"
          placeholder="请输入下一个审批节点审批人姓名，用逗号隔开"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="审批意见" prop="approvalOpinion">
        <el-input
          v-model="queryParams.approvalOpinion"
          placeholder="请输入审批意见"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <!-- <el-form-item label="选择" prop="assetSelectedData">
        <el-input
          v-model="queryParams.assetSelectedData"
          placeholder="请输入选择"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
        <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
        <el-button
          type="primary"
          plain
          @click="openForm('create')"
          v-hasPermi="['eam:asset:create']"
          v-if="props.type != 'radio'"  
        >
          <Icon icon="ep:plus" class="mr-5px" /> 新增
        </el-button>
        <el-button
          type="success"
          plain
          @click="handleExport"
          :loading="exportLoading"
          v-hasPermi="['eam:asset:export']"
          v-if="props.type != 'radio'"  
        >
          <Icon icon="ep:download" class="mr-5px" /> 导出
        </el-button>
        <el-button  plain type="warning" @click="handleImport">
          <Icon icon="ep:upload" />
          导入
        </el-button>
      </el-form-item>
      
    </el-form>
  </ContentWrap>

  <!-- 列表 -->
  <ContentWrap>
    <el-table  @current-change="handleCurrentChange" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
      <el-table-column width="35" >
        <template #default="scope">
          <el-radio
              class="radio"
              :label="scope.row"
              v-model="currentRow"  
              v-if="props.type == 'radio'"           
            >{{""}}</el-radio>
        </template>
      </el-table-column>
      <!-- <el-table-column label="主键" align="center" prop="id" /> -->
      <!-- <el-table-column label="办理状态" align="center" prop="status" /> -->
      <el-table-column label="资产编号" align="center" prop="assetCode" width="140" />
      <el-table-column label="财务编码" align="center" prop="financialCode"  width="140"/>
      <!-- <el-table-column label="资产状态" align="center" prop="assetStatus" /> -->
      <el-table-column align="center" label="资产状态" prop="assetStatus" min-width="90">
        <template #default="scope">
          <dict-tag :type="DICT_TYPE.eam_zc_status" :value="scope.row.assetStatus" />
        </template>
      </el-table-column>
      <el-table-column align="center" label="状态" prop="status" min-width="90">
        <template #default="scope">
          <dict-tag :type="DICT_TYPE.eam_status" :value="scope.row.status" />
        </template>
      </el-table-column>
      <el-table-column label="资产分类" align="center" prop="categoryName"  width="140"/>
      <el-table-column label="资产名称" align="center" prop="name" /> 
      <!-- <el-table-column align="center" label="归属公司" prop="ownCompanyId" min-width="90">
        <template #default="scope">
          <dict-tag :type="DICT_TYPE.company_type" :value="scope.row.ownCompanyId" />
        </template>
      </el-table-column> -->
      <el-table-column align="center" label="规格" prop="model" min-width="90">
        <!-- <template #default="scope">
          <dict-tag :type="DICT_TYPE.company_type" :value="scope.row.ownCompanyId" />
        </template> -->
      </el-table-column>
      <el-table-column label="保管员" align="center" prop="managerName" />
      <el-table-column label="详细地址" align="center" prop="positionDetail" />
      <el-table-column label="新增时间" align="center" prop="createTime" />
     
      <el-table-column label="操作" align="center"  v-if="props.type != 'radio'" min-width="140">
        <template #default="scope">
          <el-button
            link
            type="primary"
            @click="openForm('update', scope.row.id)"
            v-hasPermi="['eam:asset:update']"
          >
            编辑
          </el-button>
          <el-button
            link
            type="primary"
            @click="openForm2('update', scope.row.id)"
            v-hasPermi="['eam:asset:update']"
            v-if="scope.row.assetStatus != 4"
          >
            报废
          </el-button>
          <el-button
            link
            type="danger"
            @click="handleDelete(scope.row.id)"
            v-hasPermi="['eam:asset:delete']"
          >
            删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <Pagination
      :total="total"
      v-model:page="queryParams.pageNo"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />
  </ContentWrap>
</el-col>
</el-row>
  <!-- 表单弹窗：添加/修改 -->
  <AssetForm ref="formRef" @success="getList" />
  <AssetForm2 ref="formRef2" @success="getList" />
  <AssetImportForm ref="importFormRef" @success="getList" />
</template>

<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as AssetApi from '@/api/eam/asset'
import AssetForm from './AssetForm.vue'
import AssetForm2 from './AssetForm2.vue'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import DeptTree from './DeptTree.vue'
import { defaultProps, handleTree } from '@/utils/tree'
import * as UserApi from '@/api/system/user'
import AssetImportForm from './AssetImportForm.vue'
import dayjs from 'dayjs'


defineOptions({ name: 'Asset' })

const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化

const userList = ref<UserApi.UserVO[]>([]) // 全量用户清单

const loading = ref(true) // 列表的加载中
const list: any = ref([]) // 列表的数据
const total = ref(0) // 列表的总页数
const currentRow: any = ref(null)
const queryParams = reactive({
  pageNo: 1,
  pageSize: 10,
  categoryId: null,
  categoryName: null,
  categoryCode: null,
  businessCode: null,
  procId: null,
  status: null,
  batchCode: null,
  ownerCode: null,
  assetCode: null,
  assetStatus: null,
  display: null,
  cleanOutType: null,
  cleanOut: null,
  cleanTime: [],
  goodsId: null,
  name: null,
  manufacturerId: null,
  model: null,
  pictureId: null,
  unit: null,
  serviceLife: null,
  safetyLevelCode: null,
  serialNumber: null,
  ownCompanyId: null,
  managerId: null,
  useOrganizationId: null,
  useUserId: null,
  regionId: null,
  positionId: null,
  positionDetail: null,
  warehouseId: null,
  goodsStockId: null,
  sourceId: null,
  assetNumber: null,
  remainNumber: null,
  purchaseDate: [],
  productionDate: [],
  registerDate: [],
  rfid: null,
  attach: null,
  lastVerificationDate: [],
  purpose: null,
  assetNotes: null,
  maintainerId: null,
  maintainerName: null,
  maintenanceStatus: null,
  maintenancePrice: null,
  maintenanceMethod: null,
  suggestMaintenanceMethod: null,
  contacts: null,
  contactInformation: null,
  director: null,
  maintenanceStartDate: [],
  maintenanceEndDate: [],
  maintenanceNotes: null,
  financialCategoryId: null,
  financialCode: null,
  financialOption: null,
  expenseItem: null,
  supplierId: null,
  customerInfo: null,
  taxAmountPrice: null,
  totalAmountPrice: null,
  purchaseUnitPrice: null,
  originalUnitPrice: null,
  navPrice: null,
  assetUsedServiceLife: null,
  depreciationId: null,
  depreciationOperTime: [],
  residualsRate: null,
  residualsPrice: null,
  taxAmountRate: null,
  currentYearDepreciation: null,
  depreciationYear: null,
  accumulatedDepreciation: null,
  monthDepreciationPrice: null,
  entryTime: [],
  financialNotes: null,
  equipmentCode: null,
  equipmentStatus: null,
  equipmentIp: null,
  manageIp: null,
  equipmentCpu: null,
  equipmentMemory: null,
  equipmentLabel: null,
  equipmentConf: null,
  equipmentEnvironmentCode: null,
  equipmentSerialNumber: null,
  rackId: null,
  rackUpNumber: null,
  rackDownNumber: null,
  label: null,
  label3: null,
  label5: null,
  label4: null,
  label2: null,
  billId: null,
  lastInspectTime: [],
  longitude: null,
  dimension: null,
  internalControlLabel: null,
  collectionId: null,
  borrowId: null,
  scrapId: null,
  handleId: null,
  createTime: [],
  originatorId: null,
  chsType: null,
  chsStatus: null,
  chsVersion: null,
  changeInstanceId: null,
  summary: null,
  latestApproverId: null,
  latestApproverName: null,
  nextApproverIds: null,
  nextApproverNames: null,
  approvalOpinion: null,
  assetSelectedData: null,

})

const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中
const props: any = defineProps({
  type: {
    type: String,
  },
})

/** 查询列表 */
const getList = async () => {
  loading.value = true
  try {
    const data = await AssetApi.getAssetPage(queryParams)
    let _list = data.list.map((item) => {
      return {
        ...item,
        createTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD HH:mm:s') : '',
      }
    }) 
    list.value =  _list
    total.value = data.total
  } finally {
    loading.value = false
  }
}

const handleCurrentChange = (row)  => {
  console.log(row, 'row')
  currentRow.value = row;
}

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.pageNo = 1
  getList()
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value.resetFields()
  handleQuery()
}

/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
  formRef.value.open(type, id)
}

/** 添加/修改操作 */
const formRef2 = ref()
const openForm2 = (type: string, id?: number) => {
  formRef2.value.open(type, id)
}

/** 处理部门被点击 */
const handleDeptNodeClick = async (row) => {
  queryParams.categoryId = row.id
  await getList()
}

/** 导入按钮操作 */
const importFormRef = ref<InstanceType<typeof CustomerImportForm>>()
const handleImport = () => {
  importFormRef.value?.open()
}

/** 删除按钮操作 */
const handleDelete = async (id: number) => {
  try {
    // 删除的二次确认
    await message.delConfirm()
    // 发起删除
    await AssetApi.deleteAsset(id)
    message.success(t('common.delSuccess'))
    // 刷新列表
    await getList()
  } catch {}
}

/** 导出按钮操作 */
const handleExport = async () => {
  try {
    // 导出的二次确认
    await message.exportConfirm()
    // 发起导出
    exportLoading.value = true
    const data = await AssetApi.exportAsset(queryParams)
    download.excel(data, '资产.xls')
  } catch {
  } finally {
    exportLoading.value = false
  }
}

defineExpose({currentRow})

/** 初始化 **/
onMounted(async () => {
  getList()
  userList.value = handleTree(await UserApi.getSimpleUserList())
})
</script>